load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")

cc_library(
    name = "boost.timer",
    srcs = glob(["src/*.cpp"]),
    hdrs = glob(
        ["include/**/*.hpp"],
        # These headers are deprecated and should not be used.
        exclude = [
            "include/boost/progress.hpp",
            "include/boost/timer.hpp",
        ],
    ),
    features = ["parse_headers"],
    includes = ["include"],
    visibility = ["//visibility:public"],
    deps = [
        "@boost.config",
        "@boost.io",
        "@boost.predef",
    ],
)

cc_test(
    name = "chrono_conflict_test",
    srcs = ["test/chrono_conflict_test.cpp"],
    deps = [
        ":boost.timer",
        "@boost.chrono",
    ],
)

cc_test(
    name = "cpu_timer_info_test",
    srcs = ["test/cpu_timer_info.cpp"],
    local_defines = select({
        "@platforms//os:windows": ["BOOST_ALL_NO_LIB"],
        "//conditions:default": [],
    }),
    deps = [
        ":boost.timer",
        "@boost.detail",
    ],
)

cc_test(
    name = "cpu_timer_test",
    srcs = ["test/cpu_timer_test.cpp"],
    local_defines = select({
        "@platforms//os:windows": ["BOOST_ALL_NO_LIB"],
        "//conditions:default": [],
    }),
    deps = [
        ":boost.timer",
        "@boost.detail",
    ],
)

cc_test(
    name = "progress_display_test",
    srcs = ["test/progress_display_test.cpp"],
    deps = [
        ":boost.timer",
        "@boost.core",
    ],
)
